package camid.util.dataanalysis;

public class JMeterTG implements Comparable<JMeterTG> {
	
	private Integer numberOfObjects;
	
	private Integer delay;

	public JMeterTG(Integer numberOfObjects, Integer delay) {
		super();
		this.numberOfObjects = numberOfObjects;
		this.delay = delay;
	}

	public Integer getNumberOfObjects() {
		return numberOfObjects;
	}

	public void setNumberOfObjects(Integer numberOfObjects) {
		this.numberOfObjects = numberOfObjects;
	}

	public Integer getDelay() {
		return delay;
	}

	public void setDelay(Integer delay) {
		this.delay = delay;
	}

	@Override
	public int compareTo(JMeterTG arg0) {
		
		if(numberOfObjects != arg0.numberOfObjects)
		{
			return numberOfObjects - arg0.numberOfObjects;
		}
		if(delay != arg0.delay)
		{
			return delay - arg0.delay;
		}
		return 0;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((delay == null) ? 0 : delay.hashCode());
		result = prime * result
				+ ((numberOfObjects == null) ? 0 : numberOfObjects.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		JMeterTG other = (JMeterTG) obj;
		if (delay == null) {
			if (other.delay != null)
				return false;
		} else if (!delay.equals(other.delay))
			return false;
		if (numberOfObjects == null) {
			if (other.numberOfObjects != null)
				return false;
		} else if (!numberOfObjects.equals(other.numberOfObjects))
			return false;
		return true;
	}
	
	
	

}
